package com.zzl.bonds.ticket.constant;

/**
 * 跳转类型
 *
 * @author gull
 * @date 2021/12/2 15:27:08
 */
@SuppressWarnings("unused")
public enum GotoTypeEnum {

    /**
     *
     */
    GOTO_TYPE_OPEN(1, "开立"),
    GOTO_TYPE_TRANSFER(2, "转让"),
    GOTO_TYPE_CASHING(3, " 兑付"),
    GOTO_TYPE_FINANCE(5, " 融资"),
    GOTO_TYPE_SIGN_OPEN(6, "开立签收"),
    GOTO_TYPE_SIGN_TRANSFER(7, "转让签收"),
    GOTO_TYPE_OPEN_EXCEPTION(4, " 异常-开立票据"),
    GOTO_TYPE_OPEN_SIGN_EXCEPTION(8, " 异常-开立签收票据"),
    GOTO_TYPE_TRANSFER_EXCEPTION(9, " 异常-转让票据"),
    GOTO_TYPE_TRANSFER_SIGN_EXCEPTION(10, " 异常-转让签收票据"),
    ;

    private Integer code;
    private String name;

    GotoTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 通过 code 获取 name
     *
     * @param code code
     * @return name
     */
    public static String getNameByCode(Integer code) {
        for (GotoTypeEnum statusEnum : GotoTypeEnum.values()) {
            if (statusEnum.code.equals(code)) {
                return statusEnum.name;
            }
        }
        return "";
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
